<div class="breadcrumb">
        <a href="<?php echo base_url_admin;?>"><?php echo $lang['HOME'];?></a>
         ::<?php echo $lang['BAN_MANAG']; ?>
      </div>
<div class="box">
<?php
	$message = isset($_GET['message'])?$_GET['message']:"";
	switch ($message){
		case "add":
		?>
		<div class="success"><?php echo $lang['BANNER_ADD_SUCCESS'];?></div>
		<?php
			break;
		case "edit":
			?>
			<div class="success"><?php echo $lang['BANNER_EDIT_EDIT'];?></div>
			<?php
			break;
		case "publish":
			?>
			<div class="success"><?php echo $lang['BANNER_PUBLISH'];?></div>
			<?php
			break;
		case "multidelete":
			?>
			<div class="success"><?php echo $lang['BANNER_DELETE_MULTI'];?></div>
			<?php
			break;
		case "delete":
			?>
			<div class="success"><?php echo $lang['BANNER_DELETE_MULTI'];?></div>
			<?php
			break;
	}
?>
<div class="heading">
	<h1><img src="../templates/image/banner.png" alt="" />

			<?php echo $lang['BAN_MANAG']; ?>

	</h1>
	<div class="buttons">
	 <form action="process.php?action=muliDelete" method="post" id="multidelete" name="frmlist">
	 <input class="button" type="button" name="btnadd" value="<?php echo $lang['ADD_BANNER']; ?>" onClick="javascript:window.location.href='index.php?view=add&amp'; return false;" />&nbsp;&nbsp;&nbsp;
                    <input class="button" type="button" name="btnpublish" value="<?php echo $lang['PUBLISH']; ?>"  onClick="publishSelected(document.frmlist,'','No items select',1,'Banner(s)','process');" />&nbsp;&nbsp;&nbsp;
                    <input class="button" type="button" name="btnunpublish" value="<?php echo $lang['UNPUBLISH']; ?>" onClick="publishSelected(document.frmlist,'','No items select',0,'Banner(s)','process');"/>&nbsp;&nbsp;&nbsp;
                    <input class="button" type="button" name="btndelete" value="<?php echo $lang['MY_DEL']; ?>" onclick="multiDelete()" />
	</div></div>
	<div class="content">
<div class="row">
<style>
table thead tr:first-child{height:33px;text-align:center;}
</style>
<div class="clear-both"></div>
			<table class="list">
                <thead>
                <tr>
                    <td><?php echo $lang['ACC_ID']; ?></td>
                    <td align="center" ><input type="checkbox" name="chkall" id="chkall" onClick="checkAll(this.form,this.checked)" style="cursor:pointer;"></td>
                    <td><?php echo $lang['IMG']; ?></td>
                    <td><?php echo $lang['BAN_TITLE']; ?></td>
                    <td><?php echo $lang['ADD_LINK']; ?></td>
                    <td><?php echo $lang['CRETE_DATE']; ?></td>
                    <td><?php echo $lang['STATUS']; ?></td>
                    <td><?php echo $lang['ACTION']; ?></td>
                </tr>
                </thead>
                <tbody>
                <?php
                $qstring = '';
                $rowsPerPage = isset($_GET['num']) ? $_GET['num'] : '10';
                $sql = "SELECT * FROM tbl_banner";
                $result = mysql_query(getPagingQuery($sql, $rowsPerPage));
                $pagingLink = getPagingLink($sql, $rowsPerPage, $qstring);
                $i = 1;
                if(0<mysql_num_rows($result)){
                while ($row = mysql_fetch_assoc($result)) {
                    extract($row);

                    if ($i % 2) {
                        $class = 'row1';
                    } else {
                        $class = 'row2';
                    }
                    ?>
                    <tr class="<?php echo $class; ?>">
                        <td  class="p_l" width="3%" name="id[]" align="center"><?php echo $row[Tblbanner::id] ?></td>
                        <td width="3%"align="center" ><input type="checkbox" id="chkall"  style="cursor:pointer;" name="id[]" value="<?php echo $row['ban_id']; ?>"></td>
                        <td class="p_l" style="text-align:center;">
							<img src="../../images/banners/<?php echo $row[Tblbanner::image]?>" width="100"/>
						</td>
                        <td class="p_l"  align="center"><?php echo $row[Tblbanner::title]; ?></td>
                        <td class="p_l"  align="center"><?php echo $row['ban_addlink']; ?></td>

                        <td  class="p_l"  align="center"><?php echo $row['ban_datepost']; ?></td>
                        <td class="p_l"  align="center"><?php echo stateImage($ban_id, $ban_status); ?></td>
                        <td class="p_l"  align="center"><div class="btn-group"><a class="btn btn-primary btn-inverse"href="index.php?view=edit&id=<?php echo $row['ban_id'] ?>"><img width="20" src="../templates/image/Edit.gif" alt="<?php echo $lang['EDIT'];?>" /></a>
                          <a id="btnDeleteMulti" class="btn btn-primary btn-danger" onclick="return ConfirmDelete('index.php?view=delete&id=<?php echo $row['ban_id'] ?>')" href="javascript:;"><img width="20" src="../templates/image/trash.png" alt="<?php echo $lang['DELETE'];?>" /></a></div></td>
                    </tr>
                    </tbody>
                    <?php
                    $i++;
                }//end while
              }else{
				echo '<tr><td colspan="8" style="color:red;text-align:center;">No recode found here</td></tr>';
				}
                ?>
            </table>
            <div class="row-fluid">
                <div class="span7">
                    <div class="wp-pagenavi">
                        <?php echo $pagingLink; ?>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
        </form>
</div>
</div>
</div><!--<div class="row">-->